package com.timer.taskRule.entity;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;
import java.util.Stack;

@Data
public class TaskRule {

    private static TaskRule taskRule;

    private String id;

    private String taskName;

    private String path;

    private Map<String,FilePath> map = new HashMap<>();

    private TaskRule() {
    }

    public void put(String id,String path){
        map.put(id,new FilePath("",""));
    }

    public static TaskRule getInstance(){
        if(taskRule==null){
            synchronized(TaskRule.class){
                if(taskRule==null) {
                    taskRule = new TaskRule();
                    System.out.println("新创建");
                }
            }
        }
        return taskRule;
    }

    public static void clear(){
        taskRule = null;
    }

    @Data
    class FilePath{
        private String downPath;

        private String scanPath;

        public FilePath(String downPath, String scanPath) {
            this.downPath = downPath;
            this.scanPath = scanPath;
        }
    }


}
